package com.ksm.domain.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "T_JUSTIFICATIF")
public class Justificatif extends GenericEntity {

	/**
	 * 
	 */

	public static String COLUMN_NAME = "name";
	public static String COLUMN_PATH_FILE = "pathFile";
	public static String COLUMN_PATH_FILE_PREVIEW = "pathPreviewFile";

	private static final long serialVersionUID = 7919984012419968791L;

	private String name;
	private String pathFile;
	private String pathPreviewFile;
	private Document document;

	@Column(name = "NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "PATH_FILE")
	public String getPathFile() {
		return pathFile;
	}

	public void setPathFile(String pathFile) {
		this.pathFile = pathFile;
	}

	@Column(name = "PATH_PREVIEW")
	public String getPathPreviewFile() {
		return pathPreviewFile;
	}

	public void setPathPreviewFile(String pathPreviewFile) {
		this.pathPreviewFile = pathPreviewFile;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DOCUMENT_ID", nullable = false)
	public Document getDocument() {
		return document;
	}

	public void setDocument(Document document) {
		this.document = document;
	}

}
